package com.ext.bootsecurity25.config;

import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

//@Configuration
//@MapperScan(basePackages = {"com.ext.bootsecurity25.mapper"})
//@EnableTransactionManagement
//public class MyBatisConfig {
/*    @Autowired
    DataSource dataSource; // mybatis需要数据源

    // 配置当前sql会话工厂
    @Bean("sqlSessionFactoryBean")
    public SqlSessionFactoryBean configSqlSessionFactoryBean() throws Exception {
        SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
        sqlSessionFactoryBean.setDataSource(dataSource);
 //       sqlSessionFactoryBean.setTypeAliasesPackage("com.ext.bootsecurity25.entity");
//        sqlSessionFactoryBean.setMapperLocations("classpath:db.properties");
        return sqlSessionFactoryBean;
    }*/
//}

